package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bean.SellCarBean;
import com.project.bean.SellInfoBean;
import com.project.bean.StatSellBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface ISellInfoMapper extends BaseMapper<SellInfoBean> {
    void addSellInfo(@Param("sellId") Integer sellId,
                     @Param("sellCarList") List<SellCarBean> sellCarList);

    @Select("SELECT ti.* FROM t_sell ts,t_sellInfo ti WHERE " +
            "ts.pk_sellId = ti.fk_sellId AND ts.pk_sellId = #{id}")
    @ResultMap("sellInfoMapper")
    List<SellInfoBean> findInfo(Integer id);

    List<SellInfoBean> findList(Integer saleId);
}
